using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;

namespace IEQ_Superintendencia.Services.Persistence
{
    class BDConexao
    {
        private static BDConexao instance;

        public static BDConexao getInstance()
        {
            if (instance == null)
                instance = new BDConexao();

            return instance;
        }

        public SqlConnection getConnection()
        {
            String connectionString = ConfigurationManager.AppSettings["ConnectionString"];             
            SqlConnection con = new SqlConnection(connectionString);  
            

            try
            {
                con.Open();
            }
            catch (SqlException e)
            {
                e.ToString();
            }
            catch (Exception e)
            {
                e.ToString();
            }

            return con;

        }


    }
}